﻿#ifndef SAVEDEVTOTOMODELFILE_H
#define SAVEDEVTOTOMODELFILE_H

#include "db_cfg_g_def.h"
#include "DbCfgFun.h"
#include <QDialog>
#include <QString>
#include "MyFileOper.h"

namespace Ui {
    class SaveDevToModelFile;
}

class SaveDevToModelFile : public QDialog {
    Q_OBJECT
public:
    SaveDevToModelFile(int AppType, int TableId, unsigned int RecordId,QWidget *parent = 0);
    ~SaveDevToModelFile();


	void	InitShow();

	//保存设备模板文件
	int	SaveDeviceFile();


	int SaveDeviceYx_toFile(unsigned int Device_Id);
	int SaveDeviceYc_toFile(unsigned int Device_Id);
	int SaveDeviceYk_toFile(unsigned int Device_Id);
	int SaveDeviceYm_toFile(unsigned int Device_Id);
	int SaveDeviceBhYc_toFile(unsigned int Device_Id);
	
	int SaveModelSet_toFile(unsigned int DevMode_Id);
	int SaveModelPara_toFile(unsigned int DevMode_Id);
	int SaveModelPrec_toFile(unsigned int DevMode_Id);
	int SaveModelArea_toFile(unsigned int DevMode_Id);
	int SaveRYB_toFile(unsigned int Device_Id);
protected:
	void changeEvent(QEvent *e);

protected slots:
		void AffirmBtn();

private:
	Ui::SaveDevToModelFile *ui;

	MyFileOper		m_FileOper;
	int			m_AppType;
	int			m_TableId;
	unsigned int			m_RecordId;

	char			m_strBuff[TEMP_BUFF_LEN];

	int			m_DevYxNum;
	int			m_DevYcNum;
	int			m_DevYkNum;
	int			m_DevYmNum;
// 	int			m_DevFixValNum;
// 	int			m_DevRlySOENum;
// 	int			m_DevCheckSelfNum;
// 	int			m_DevRlySamplingNum;

	QString			m_DevName;
	QString			m_ModelFileName;
	QString			m_ModelAllFileName;
};

#endif // SAVEMODELTOFILE_H
